package ru.ifmo.trafficspy.tests;


import static org.junit.Assert.assertTrue;

import java.util.ArrayList;

import org.junit.Before;
import org.junit.Test;

import ru.ifmo.trafficspy.analyzer.clustering.KMeansClusterizer;

public class KMeansClusterizerTest {

	private KMeansClusterizer kmc;
	
	@Before
	public void setUp() throws Exception {
		kmc = new KMeansClusterizer(new double[] {2, 3, 0});
	}
	
	@Test
	public void test1() {
		assertTrue(kmc.getCluster(2) == 0);
		assertTrue(kmc.getCluster(1.5) == 0);
		assertTrue(kmc.getCluster(0.5) == 2);
		assertTrue(kmc.getCluster(3.5) == 1);
		assertTrue(kmc.getCluster(-10) == -1);
	}
	
}
